function dx = plant(t, x)
    dx = zeros(12, 1);
%***************************变量简化**************************************
e_phi   = x(1);   de_phi    = x(2);
e_theta = x(3);   de_theta  = x(4);
e_psi   = x(5);   de_psi    = x(6);
int_phi = x(7);   int_theta = x(8);    int_psi = x(9);
g_phi   = x(10);  g_theta   = x(11);   g_psi   = x(12);
%***************************系统参数**************************************
Jx = 5.455e-3;  Jy = 5.455e-3;  Jz = 1.089e-2;
beta0 = 1.5;    beta1 = 6.0;
k1 = 5.0;   k2 = 1.0;   k3 = 7.0;   k4 = 20.0;
k5 = 1.0;   k6 = 1.0;   k7 = 1.0;   k8 = 5.0;
%***************************期望轨迹**************************************
phi_d   = -0.05+0.2*sin(2*pi/5*t);
theta_d = -0.05+0.2*sin(2*pi/5*t);
psi_d   = -0.05+0.2*sin(2*pi/5*t);

dphi_d   = 2*pi/5*0.2*cos(2*pi/5*t);
dtheta_d = 2*pi/5*0.2*cos(2*pi/5*t);
dpsi_d   = 2*pi/5*0.2*cos(2*pi/5*t);

ddphi_d   = -2*pi/5*2*pi/5*0.2*sin(2*pi/5*t);
ddtheta_d = -2*pi/5*2*pi/5*0.2*sin(2*pi/5*t);
ddpsi_d   = -2*pi/5*2*pi/5*0.2*sin(2*pi/5*t);
%***************************系统干扰**************************************
d_phi   = -Jx*(1+sin(0.2*pi*t));
d_theta = -Jy*(1+sin(0.2+0.3*pi*t));
d_psi   = -Jz*(1+sin(0.5+0.2*pi*t));
%***************************欧拉角****************************************
dphi = de_phi + dphi_d;
dtheta = de_theta + dtheta_d;
dpsi = de_psi + dpsi_d;
%***************************滑模面****************************************
sphi    = de_phi    + int_phi;
stheta  = de_theta  + int_theta;
spsi    = de_psi    + int_psi;
%***************************控制输入**************************************
tao_phi     = Jx * ( -(Jy-Jz)/Jx * dtheta * dpsi + ddphi_d  - beta1*( sig(de_phi  ,2/3) + beta0*sig(e_phi  ,1/2) ) - k1*sig(sphi  ,1/2)-k2*sphi  +g_phi );
tao_theta   = Jy * ( -(Jz-Jx)/Jy * dphi   * dpsi + ddtheta_d- beta1*( sig(de_theta,2/3) + beta0*sig(e_theta,1/2) ) - k1*sig(stheta,1/2)-k2*stheta+g_theta );
tao_psi     = Jz * ( -(Jx-Jy)/Jz * dtheta * dphi + ddpsi_d  - beta1*( sig(de_psi  ,2/3) + beta0*sig(e_psi  ,1/2) ) - k1*sig(spsi  ,1/2)-k2*spsi  +g_psi);
%***************************系统******************************************
dx(1) = x(2);
dx(2) = (Jy-Jz)/Jx * dtheta * dpsi + 1/Jx * tao_phi   - ddphi_d   + 1/Jx*d_phi;
dx(3) = x(4);
dx(4) = (Jz-Jx)/Jy * dphi   * dpsi + 1/Jy * tao_theta - ddtheta_d + 1/Jy*d_theta;
dx(5) = x(6);
dx(6) = (Jx-Jy)/Jz * dtheta * dphi + 1/Jz * tao_psi   - ddpsi_d   + 1/Jz*d_psi;
%***************************滑模面积分部分********************************
dx(7) = beta1*( sig(de_phi  ,2/3) + beta0*sig(e_phi  ,1/2) );
dx(8) = beta1*( sig(de_theta,2/3) + beta0*sig(e_theta,1/2) );
dx(9) = beta1*( sig(de_psi  ,2/3) + beta0*sig(e_psi  ,1/2) );
%***************************控制率切换部分********************************
dx(10) = -k3 * sign(sphi)   - k4 * sphi;
dx(11) = -k3 * sign(stheta) - k4 * stheta;
dx(12) = -k3 * sign(spsi)   - k4 * spsi;
end


